﻿/**
 * Jean-François Desgagné 2009 Portfolio
 * Copyright (c) 2009 Jean-François Desgagné <jfesgagne@gmail.com>
 * 
 * This work is licensed under a Creative Commons Attribution 3.0 United States License.
 * Some Rights Reserved.
 */
package com.jfdesgagne.jfdesgagne09.shell.controller {
    import org.puremvc.as3.multicore.interfaces.ICommand;
    import org.puremvc.as3.multicore.interfaces.INotification;
    import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	import com.jfdesgagne.jfdesgagne09.shell.ApplicationFacade;
	import com.jfdesgagne.jfdesgagne09.shell.model.FrameProxy;
	import com.jfdesgagne.jfdesgagne09.shell.view.component.Site;
	import com.jfdesgagne.jfdesgagne09.shell.view.component.Tooltip;
	import com.jfdesgagne.jfdesgagne09.shell.view.SiteMediator;
	import com.jfdesgagne.jfdesgagne09.shell.view.TooltipMediator;
	import com.jfdesgagne.jfdesgagne09.shell.view.StageMediator;
	import gs.plugins.*;
	
    public class PrepAppCommand extends SimpleCommand implements ICommand {
        override public function execute(note:INotification):void {
			TweenPlugin.activate([RemoveTintPlugin, TintPlugin]);
			
			this.facade.registerProxy(new FrameProxy());
			
			var site:Site = new Site();
			StageMediator.getInstance().stage.addChild(site);
        	this.facade.registerMediator(new SiteMediator(site));
			
			var tooltip:Tooltip = new Tooltip();
			this.facade.registerMediator(new TooltipMediator(tooltip));
			this.sendNotification(ApplicationFacade.INITIALIZE);
        }
    }
}